<template>
  <div>
    
  </div>
</template>
<script setup lang="ts"> 
import {reactive} from 'vue'
  // omit 继承时候忽略某些属性

  // Pick 继承时候只继承某些属性
  interface Icar{
    name:string,
    color:string,
    price:number,
    make:string,
    run():void
  }
//  继承时候只继承某些属性
type Ibenchi=Pick<Icar,"name"|"price"|"run">
let maibahe=reactive<Ibenchi>({
  name:"迈巴赫s680",
  price:1000,
  run(){
    console.log("跑起来")
  }
})
// Partial 将所有的属性变成可选的
interface Iperson{
  name:string,
  age:number,
  sex:string,
  eat():void
}
let xiaoming=reactive<Partial<Iperson>>({
  name:"小明",
  sex:"男"
})
// Required 将所有的属性变成必选的
interface Istu{
  name?:string,
  age?:number,
  sex?:string
}
let xiaohong=reactive<Required<Istu>>({
  name:"小红",
  age:18,
  sex:"女"
})



</script>